package Homework1;

import java.util.Scanner;

public class Homework1_4 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int sum = 0;
        while (n != 0){
            int a = n % 10;
            sum += a;
            n /= 10;
        }
        System.out.println(sum);
    }
}
